<?php
/***
 * $sql="SELECT op_value FROM ".$this->ecs->table('options')." WHERE op_key='appid'";
 * $is_appid=$this->db->getOne($sql);
 */

class marketModel{
	private $db;
	private $ecs;
	public function __construct(){
		$this->db = $GLOBALS['db'];
		$this->ecs = $GLOBALS['ecs'];
	}
	
	public function get_market_info(){
		//首页广告
		$sql="SELECT ad_id,ad_name,ad_link,ad_code FROM ".$this->ecs->table("ad")." WHERE position_id =1 AND enabled=1";
		$result['ad']  = $this->db->getAll($sql);
		//分类
		$cat_list = get_categories_tree();
		$result['cat_list'] = $cat_list;
// 		assign_template();
		//热销产品列表
		$result['hot_goods'] = get_recommend_goods('hot',"",10);
		return $result;
	}
}